# $LastChangedDate: 2007-06-21 14:06:23 +0200 (Thu, 21 Jun 2007) $
# $LastChangedRevisio$
# $LastChangedBy: david $


CC = g++
LD = g++
CDEBUG = -ggdb -g
CFLAGS = -Wall
LDFLAGS = -lpthread
OBJS = BlockingObject.o Client.o ClientSocket.o Excepcions.o \
  FileLock.o FileMngr.o Log.o Main.o Server.o ServerSocket.o \
  Socket.o Thread.o
SRCS = BlockingObject.cpp Client.cpp ClientSocket.cpp Excepcions.cpp \
  FileLock.cpp FileMngr.cpp Log.cpp Main.cpp Server.cpp ServerSocket.cpp \
  Socket.cpp Thread.cpp
PROG = main

all: $(PROG)

$(PROG): $(OBJS)
	$(LD) $(LDFLAGS) $(OBJS) -o $(PROG)

%.o: %.c
	$(CC) $(CFLAGS) -c $<

BlockingObject.o: BlockingObject.cpp BlockingObject.h Excepcions.h
Client.o: Client.cpp Log.h FileMngr.h ServerSocket.h Socket.h Thread.h \
  BlockingObject.h FileLock.h Client.h ServerErrorException.h Server.h \
  ClientSocket.h SocketException.h
ClientSocket.o: ClientSocket.cpp ClientSocket.h Socket.h \
  SocketException.h
Excepcions.o: Excepcions.cpp Excepcions.h
FileLock.o: FileLock.cpp FileLock.h BlockingObject.h FileMngr.h \
  ServerSocket.h Socket.h Thread.h Log.h Client.h ServerErrorException.h \
  Server.h
FileMngr.o: FileMngr.cpp FileMngr.h ServerSocket.h Socket.h Thread.h \
  BlockingObject.h Log.h Client.h ServerErrorException.h Server.h \
  FileLock.h SocketException.h CouldNotOpenFileException.h \
  InvalidModeException.h
Log.o: Log.cpp Log.h FileMngr.h ServerSocket.h Socket.h Thread.h \
  BlockingObject.h FileLock.h Client.h ServerErrorException.h Server.h
Main.o: Main.cpp Log.h FileMngr.h ServerSocket.h Socket.h Thread.h \
  BlockingObject.h FileLock.h Client.h ServerErrorException.h Server.h
Server.o: Server.cpp Log.h FileMngr.h ServerSocket.h Socket.h Thread.h \
  BlockingObject.h FileLock.h Client.h ServerErrorException.h Server.h \
  SocketException.h
ServerSocket.o: ServerSocket.cpp ServerSocket.h Socket.h \
  SocketException.h
Socket.o: Socket.cpp Socket.h
Thread.o: Thread.cpp Excepcions.h Thread.h BlockingObject.h

.PHONY: clean
clean:
	/bin/rm -f $(OBJS) $(PROG)
